<template>
  <ul>
    <router-link
      class="name"
      tag="li"
      :to="`/detail/${shoplist.id}`"
      v-for="shoplist in shoplist"
      :key="shoplist.id"
    >
      <div class="img"><img :src="shoplist.image" /></div>
      <div class="font">
        <div class="van-ellipsis" style="padding: 5px">
          {{ shoplist.store_name }}
        </div>
        <div class="price">
          <span>
            <b style="color: var(--cy-Color)">￥{{ shoplist.price }}</b>
          </span>
          <span>
            <b style="font-size: 14px">￥{{ shoplist.vip_price }}</b>
            <img
              width="24"
              src=""
            />
            <span class="right" style="color: #666">已售{{ shoplist.sales }}</span><span style="color: #666" v-if="shoplist.unit_name">{{shoplist.unit_name}}</span>
            <van-icon name="cart-circle-o" />
          </span>
        </div>
      </div>
    </router-link>
  </ul>
</template>
<script>
export default {
  name: "ShopList",
  props: {
    shoplist: {
      type: Array,
      default: function () {
        return [];
      },
      id: [String, Number],
    },
  },
};
</script>
<style scoped lang="less">
ul {
  width: 100%;
  .name {
    margin: 10px;
    display: flex;
    .img {
      width: 90px;
      height: 90px;
      img {
        height: 100%;
        width: 100%;
      }
    }
    .font {
      flex: 1;
      font-size: 14px;
      height: 14px;
      width: 75%;
    }
  }
}
.price {
  display: flex;
  flex-direction: column;
  span {
    padding-top: 10px;
      font-size: 12px;
    b {
      font-size: 20px;
      font-weight: bold;
    }
    span.right {
      padding: 5px 0px 5px 5px;
    }
    i {
      color: var(--cy-Color);
      position: absolute;
      right: 15px;
      font-size: 25px;
    }
  }
}
</style>